//
//  HomePage.m
//  MIC_MoveModelExample
//
//  Created by 李爽 on 15/11/16.
//  Copyright (c) 2015年 Shawn Li. All rights reserved.
//

#import "HomePage.h"
#import "PageInfo.h"

@interface HomePage ()

@end

@implementation HomePage

+ (void)initialize
{
    // 通过appearance统一设置所有UITabBarItem的文字属性
    // 后面带有UI_APPEARANCE_SELECTOR的方法, 都可以通过appearance对象来统一设置
    NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
    attrs[NSFontAttributeName] = [UIFont systemFontOfSize:12];
    attrs[NSForegroundColorAttributeName] = [UIColor grayColor];
    
    NSMutableDictionary *selectedAttrs = [NSMutableDictionary dictionary];
    selectedAttrs[NSFontAttributeName] = attrs[NSFontAttributeName];
    selectedAttrs[NSForegroundColorAttributeName] = [UIColor redColor];
    
    UITabBarItem *item = [UITabBarItem appearance];
    [item setTitleTextAttributes:attrs forState:UIControlStateNormal];
    [item setTitleTextAttributes:selectedAttrs forState:UIControlStateSelected];
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self addTabChildViewControllers];
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
}

- (void)addTabChildViewControllers {
    //设置颜色
    //self.tabBar.tintColor = RGB(255, 145, 64);
    self.tabBar.backgroundImage = [UIImage imageNamed:@"tab_bar_img"];
    self.viewControllers = [PageInfo pageControllers];
}


@end
